<?php


namespace App\Http\Controllers\applets\model;


use Illuminate\Support\Facades\DB;

class AdminModel
{
    public static function queryFirst($where,$field){
        return DB::table('t_admin')->where($where)->first($field);
    }

    public static function edit($where,$param){
        return DB::table('t_admin')->where($where)->update($param);
    }

    public static function queryWhere($where,$field){
        return DB::table('t_admin')
            ->leftJoin('t_group as g','t_admin.t_group_id','=','g.id')
            ->where($where)
            ->first($field);
    }

    public static function queryFirstOrWhere($where,$orWhere,$field){
        return DB::table('t_admin')->where($where)->orWhere($orWhere)->first($field);
    }

    public static function add($param){
        return DB::table('t_admin')->insert($param);
    }

    public static function login($where,$orWhere,$field){
        return DB::table('t_admin')->where($where)->orWhere($orWhere)->first($field);
    }

    public static function insertGetId($param){
        return DB::table('t_admin')->insertGetId($param);
    }


}